package com.xiaocz.common.utils;

import java.text.DecimalFormat;

/**
 * Author:  bozaixing.
 * Email:   654152983@qq.com.
 * Date:    2018/5/25.
 * Descr:
 */
public class TypeConversionUtils {

    // 单例对象
    private static volatile TypeConversionUtils sInstance;
    /**
     * 获取单例对象
     *
     * @return
     */
    public static TypeConversionUtils getInstance() {
        if (sInstance == null) {
            synchronized (TypeConversionUtils.class) {
                if (sInstance == null) {
                    sInstance = new TypeConversionUtils();
                }
            }
        }
        return sInstance;
    }

    /**
     *
     * @param pattern  "#.##"
     * @return
     */
    public DecimalFormat getDecimalFormat(String pattern){
        DecimalFormat df=new DecimalFormat(pattern);
        return df;
    }
}
